#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>

#include <video_cap.hpp>

int main(void)
{
    const char *url = "rtsp://admin:ctgu2016@192.168.10.223/h264/ch1/main/av_stream";
    VideoCap cap;
    int ret = cap.open(url);

    if(!ret)
    {
        printf("Open Url Failed!!!\n");
        return -1;
    }

   int step = 0;

    while(1)
    {
        printf("Frame: %d end= ", step);

        uint8_t *frame;
        int width = 0;
        int height = 0;
        char ftype[64];
        MVS_DTYPE* motion_vectors;
        MVS_DTYPE  num_mvs;
       double frame_timestamp;

       ret = cap.read(&frame, &width, &height, ftype, &motion_vectors, &num_mvs, &frame_timestamp);

       printf("Width:%d Height:%d\n", width, height);
    }
    return 0;
}
